using System;
using System.Windows.Forms;
using BizTalk.BuildGenerator.UI.Navigation;
using System.Collections.Generic;
using BizTalk.BuildGenerator.MetaData;

namespace BizTalk.BuildGenerator.UI.UserControls
{
    public partial class BizTalkHostsControl : UserControl, IWizardControl
    {
        private GenerationArgs _Args;
       
        public void RegisterHosts(GenerationArgs args)
        {
            _Args = args;
            BizTalkHostsPropertyGrid.SelectedObject = _Args.BizTalkHosts;
        }

        public BizTalkHostsControl()
        {
            InitializeComponent();
        }
       
        #region IWizardControl Members

        public MoveNextResult MoveNext()
        {
            MoveNextResult result = new MoveNextResult();
            result.CanMoveNext = true;
            return result;
        }

        #endregion

        private void BizTalkHostsControl_Load(object sender, EventArgs e)
        {
            if (!DesignMode)
            {                
                foreach(BizTalkHost host in _Args.BizTalkHosts.Hosts)
                    host.RefreshAdapters();
            }
        }               
    }
}